package com.tjetc.service.impl;

import com.tjetc.dao.FeeDao;
import com.tjetc.dao.OrderDao;
import com.tjetc.dao.OtcDao;
import com.tjetc.dao.impl.FeeDaoImpl;
import com.tjetc.dao.impl.OrderDaoImpl;
import com.tjetc.dao.impl.OtcDaoImpl;
import com.tjetc.domain.Otc;
import com.tjetc.service.OtcService;

import java.sql.SQLException;
import java.util.List;

public class OtcServiceImpl implements OtcService {
    private OtcDao otcDao = new OtcDaoImpl();
    private FeeDao feeDao = new FeeDaoImpl();
    private OrderDao orderDao = new OrderDaoImpl();
    @Override
    public boolean add(Otc otc) {
        try {
            otcDao.add(otc);
            return true;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }

    @Override
    public List<Otc> listByRid(int rid) {
        try {
            return otcDao.listByRid(rid);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
